#include <stdio.h>

#include "fread.h"

void init_test_grid(grid * g) {
    FILE *ptr_file;
    int i,j;

    ptr_file = fopen("test.txt", "r");

    if (!ptr_file)
        return init_grid(g);

    for (i = 0; i < g->rows; ++i)
    {
        for (j = 0; j < g->columns; ++j)
        {
            fscanf(ptr_file,"%d ", &g -> grid[i][j]);
        }
        fscanf(ptr_file,"\n");
    }

    fclose(ptr_file);
}
